<template>
  <div class="home-overview">
    <el-row :gutter="16">
      <el-col v-for="(item, index) in columns" :key="index" :span="6">
        <div class="grid-content">
          <div class="grid-content-title">{{ item.title }}</div>
          <div class="grid-content-date">
            <template v-if="item.type === 'day'">
              {{ `${formatDate()}(${todayWeek()})` }}
            </template>
            <template v-else>
              {{ `${formatDate(0, 'YYYY-MM')}月` }}
            </template>
          </div>
          <div class="grid-content-value">
            <span>30</span>
            <img src="@/assets/navCardImg/add_account.png" />
          </div>
          <div class="grid-content-same">
            <div class="same-li">
              <span class="text">昨日同期</span>
              <el-icon size="16" color="#df4034">
                <CaretTop />
              </el-icon>
              <span class="is-up">4</span>
            </div>
            <div class="same-li">
              <span class="text">七日均值</span>
              <span>4</span>
            </div>
            <!-- <div class="same-li">
              <span class="text">昨日同期</span>
              <el-icon size="16" color="#00a854">
                <CaretBottom />
              </el-icon>
              <span>4</span>
            </div> -->
            <!-- <i
              v-if="data.value < data.y_value"
              class="el-icon-caret-bottom is-down"
            /> -->
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
// others
import { columns, formatDate, todayWeek } from './config'
</script>

<style lang="less" scoped>
// .el-row {
//   margin-bottom: 20px;
// }
// .el-row:last-child {
//   margin-bottom: 0;
// }
// .el-col {
//   border-radius: 4px;
// }
.grid-content {
  height: 148px;
  padding: 16px 30px 16px 16px;
  margin-bottom: 16px;
  box-shadow: 0px 0px 10px 0px rgba(213, 217, 222, 0.5);
  border-radius: 4px;
  background: #fff;
}
.grid-content-title {
  font-size: 14px;
}
.grid-content-date {
  font-size: 12px;
  color: #82888f;
  margin-top: 8px;
}
.grid-content-value {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  height: 28px;
  font-size: 32px;
  font-weight: 500;
  color: #333;
  img {
    width: 34px;
    height: 34px;
    margin-top: -10px;
  }
}
.grid-content-same {
  display: flex;
  margin-top: 22px;
  font-size: 12px;
  color: #51565c;
  .same-li {
    width: 50%;
    display: flex;
    align-items: center;
    &:last-child {
      margin-left: 10px;
    }
  }
  .text {
    margin-right: 5px;
  }
}
.is-down {
  color: #00a854;
}
.is-up {
  color: #df4034;
}
</style>
